<?php
/**
 * Stores all api calls about tracks 
 * @package api
 * @Author Antonio Trigiani
 * Mail:info@webprojectsolution.com | info@zivagoo.com
 * Twitter:http://twitter.com/al0ha
 * @2010 v.0.1
**/
?>
<html><head><title>MusixMatch Api PHP Example Page</title></head>
<body>
<h1>MusixMatch API PHP Library written by Antonio Trigiani </h1>
<p>Checkout <a href="http://musixmatch.com/" title="MusixMatch">MusixMatch</a> API. Lyrics, not only words.</p>
<p>The Blog of the developer of this library <a href="http://iblog.webprojectsolution.com/" title="Antonio Trigiani">Antonio</a></p>
<p>Enjoy it! :)</p>
<?php 
require ('mxmapi.php');
$authVars = array(	'apikey' => 'YOUR_MXM_API_KEY');
$config = array('enabled' => false,	'path' => './');
$apiClass = new mxmApi();
$artistClass = $apiClass->getPackage($authVars, 'artist', $config);
$methodVars = array('q_artist' => 'Radiohead');
$methodVars = array_merge($methodVars,$authVars);
$artistClass = new mxmApiArtist($authVars, 'artist', $config);
if ( $artist = $artistClass->artist_Search($methodVars) ) {
	echo '<b>Results</b>';
	echo '<pre>';
	print_r($artist);
	echo '</pre>';
}
else {
	die('<b>Error '.$artistClass->error['code'].' - </b><i>'.$artistClass->error['desc'].'</i>');
}
 
$trackClass = new mxmApiTrack($auth, 'track', $config);
if ( $track = $trackClass->track_Search($methodVars) ) {
	echo '<b>Results</b>';
	echo '<pre>';
	print_r($track);
	echo '</pre>';
}
else {
	die('<b>Error '.$trackClass->error['code'].' - </b><i>'.$trackClass->error['desc'].'</i>');
}
 
$methodVars = array('country' => 'IT','page_size' => '8','page' => '1');
$methodVars = array_merge($methodVars,$authVars);
$trackClass = new mxmApiTrack($auth, 'track', $config);
if ( $chart = $trackClass->chart_Get($methodVars) ) {
	echo '<b>Results</b>';
	echo '<pre>';
	print_r($chart);
	echo '</pre>';
}
else {
	die('<b>Error '.$trackClass->error['code'].' - </b><i>'.$trackClass->error['desc'].'</i>');
}
?>
</body></html>
<?php
exit();
?>